package ecomp.uefs.micc.sharedbox.model;

import java.io.IOException;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;

import javax.swing.JOptionPane;

public class Client {
	
	public static void main(String[] args) 
	         throws UnknownHostException, IOException {
	     // Start Client
	     new Client("127.0.0.1", 12345).start();
	   }
	
	private String host = "127.0.0.1";
	private int port = 12345;
	private User user;
	
	public Client(String host, int port){
		this.host = host;
		this.port = port;
	}
	
	public void start(){
		
		try {
			Socket client = new Socket(this.host, this.port);
			
			JOptionPane.showMessageDialog(null, "Client Connected!", "Client Runing", 1);
		} catch (UnknownHostException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			JOptionPane.showMessageDialog(null, "Client Not Connected!", "Client", 1);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}

	public User getUser(){		
		return user;
	}
	
	public void setUser(User user){
		this.user = user;
	}

}
